Optimal. Leaf size=55 \[ -\frac {a \sin (e+f x) \cos (e+f x)}{2 f}+\frac {a x}{2}+\frac {b \cos ^3(e+f x)}{3 f}-\frac {b \cos (e+f x)}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.04, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {2748, 2635, 8, 2633} \[ -\frac {a \sin (e+f x) \cos (e+f x)}{2 f}+\frac {a x}{2}+\frac {b \cos ^3(e+f x)}{3 f}-\frac {b \cos (e+f x)}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2633
Rule 2635
Rule 2748
Rubi steps
\begin {align*} \int \sin ^2(e+f x) (a+b \sin (e+f x)) \, dx &=a \int \sin ^2(e+f x) \, dx+b \int \sin ^3(e+f x) \, dx\\ &=-\frac {a \cos (e+f x) \sin (e+f x)}{2 f}+\frac {1}{2} a \int 1 \, dx-\frac {b \operatorname {Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (e+f x)\right )}{f}\\ &=\frac {a x}{2}-\frac {b \cos (e+f x)}{f}+\frac {b \cos ^3(e+f x)}{3 f}-\frac {a \cos (e+f x) \sin (e+f x)}{2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.06, size = 60, normalized size = 1.09 \[ \frac {a (e+f x)}{2 f}-\frac {a \sin (2 (e+f x))}{4 f}-\frac {3 b \cos (e+f x)}{4 f}+\frac {b \cos (3 (e+f x))}{12 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.45, size = 46, normalized size = 0.84 \[ \frac {2 \, b \cos \left (f x + e\right )^{3} + 3 \, a f x - 3 \, a \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 6 \, b \cos \left (f x + e\right )}{6 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 50, normalized size = 0.91 \[ \frac {1}{2} \, a x + \frac {b \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac {3 \, b \cos \left (f x + e\right )}{4 \, f} - \frac {a \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.16, size = 49, normalized size = 0.89 \[ \frac {-\frac {b \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}+a \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.65, size = 48, normalized size = 0.87 \[ \frac {3 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a + 4 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b}{12 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.57, size = 68, normalized size = 1.24 \[ \frac {a\,x}{2}-\frac {-a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+4\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+a\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+\frac {4\,b}{3}}{f\,{\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.74, size = 92, normalized size = 1.67 \[ \begin {cases} \frac {a x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {a x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {a \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {b \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 b \cos ^{3}{\left (e + f x \right )}}{3 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\relax (e )}\right ) \sin ^{2}{\relax (e )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________